#include "IPCAM_Export.h"
#include "Daemon_Init.h"
#include "Daemon_DevFound.h"
#include "Daemon_DevFoundBrost.h"
#include "Daemon_UpgradeByNet.h"
#include "Daemon_Common.h"

static void Daemon_StartNetServer(LPTHREAD_ARG* Sarg_Net)
{
//	Daemon_StartNetFound(Sarg_Net);
	Daemon_StartNetBroadCastFound(Sarg_Net);
#ifndef SYSTEM_SAFE_MODE
	Daemon_StartUpGradeByNet(Sarg_Net); //通过网络启动的更新
#endif /* SYSTEM_SAFE_MODE */
}

int daemon_run(void)
{   
	THREAD_ARG Sarg_Net;
	THREAD_ARG Sarg_SD;
    
	Daemon_InitSem(&Sarg_Net.sem);
	Daemon_InitSem(&Sarg_SD.sem);
       
	Daemon_StartNetServer(&Sarg_Net);

	Daemon_DestorySem(&Sarg_Net.sem);
	Daemon_DestorySem(&Sarg_SD.sem);

	return 0;
}

